import type { VxeTableGridOptions } from '#/adapter/vxe-table';

import { $t } from '#/locales';

/** 商机关联列表列定义 */
export function useBusinessDetailListColumns(): VxeTableGridOptions['columns'] {
  return [
    {
      type: 'checkbox',
      width: 50,
      fixed: 'left',
    },
    {
      field: 'name',
      title: $t('views.crm.business.name'),
      fixed: 'left',
      slots: { default: 'name' },
    },
    {
      field: 'customerName',
      title: $t('views.crm.common.customer'),
      fixed: 'left',
      slots: { default: 'customerName' },
    },
    {
      field: 'totalPrice',
      title: $t('views.crm.business.businessPrice'),
      formatter: 'formatAmount2',
    },
    {
      field: 'dealTime',
      title: $t('views.crm.business.dealTime'),
      formatter: 'formatDate',
    },
    {
      field: 'ownerUserName',
      title: $t('views.crm.common.ownerUserId'),
    },
    {
      field: 'ownerUserDeptName',
      title: $t('views.crm.common.ownerUserDept'),
    },
    {
      field: 'statusTypeName',
      title: $t('views.crm.business.statusType'),
      fixed: 'right',
    },
    {
      field: 'statusName',
      title: $t('views.crm.business.phase'),
      fixed: 'right',
    },
  ];
}
